<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Account extends Controller{
	//建立表映射
	var $controller_user = "user";
	var $controller_group = "group";
	var $controller_role = "role";
	
	function Account(){
		parent::Controller();
		$this->load->model('crud');
		$this->load->model('display');
	}
	
	function index(){
		echo 'Account';
	}
	/* 创建 */	
	function user_new($data= NULL,$id = NULL)
	{
		$data = $this->display->data;
		$data['mytitle'] = 'Add New User';			
		$data['mycontent'] = $this->crud->save($this->controller_user,$id);
		//加载视图 
		$this->display->dashboard($data);
		$this->load->view('derived/user_new');
		$this->load->view('base/footer_view');		
	}
	function user_save($id){
		$this->crud->save($this->controller_user, $id); 
	}
	function interim(){
		//$this->crud->insert($this->controller, $_POST);  
	}
	
	function user_manage(){
		
	}
	
	function group_new($data = NULL)
	{
		
	}
	
	function role_new($data = NULL)
	{
		
	}
	
	/* 删除 */
	function user_del($id=NULL){
		
	}
	
	function role_del($id=NULL){
		
		/* 删除角色 */
		
		/* TODO:删除角色-组表中包含此角色的记录 */
		
		}	
	function group_del($id=NULL){
		
	}
}
?>